<script setup>
import baseModel from "@/components/baseModel/baseModel.vue";
import { ref, provide, watch } from "vue";
import { useRouter } from "vue-router";
const dialog = ref(null);
// 文案仿写
import TextImitation from "@/views/shotstack/MatrixMarketing/TextImitation/index.vue";
const TextImitationRef = ref(null);
const emit = defineEmits(["getTextArr:list"]);
const props = defineProps({
  // 文案仿写 是否为组件模式
  isComponents: {
    type: Boolean,
    default: true,
  },

  isonece: {
    type: Boolean,
    default: false,
  },
    isone_num: {
    type: Boolean,
    default: false,
  },

  TextContent: {
    type: String,
    default: "",
  }
});

// 获得组件选择的
const getTextArr = (list) => {
  emit("getTextArr", list);
};

const showModal = () => {
  dialog.value.showModal();
};
const closeModal = () => {
  dialog.value.closeModal();
};

// 将是否是组件模式, 传递给内部的子孙组件
provide("isComponents", props.isComponents);
provide("isonece", props.isonece);
provide("isone_num", props.isone_num);
provide("getTextArr", getTextArr);


defineExpose({
  showModal,
  closeModal,
});
</script>

<template>
  <div>
    <!-- contentWidth="1350px" -->
    <baseModel
      ref="dialog"
      contentWidth="1150px"
      :maskClosable="false"
      :zIndex="1001"
    >
      <template #title>
        <span>文案仿写</span>
      </template>
      <template #content>
        <div class="content">
          <TextImitation
            ref="TextImitationRef"
            :isComponents="true"
          ></TextImitation>
        </div>
      </template>
      <template #footer>
        <div class="bottom"></div>
      </template>
    </baseModel>
  </div>
</template>

<style lang="less" scoped>
@fontColor: #1c1f23;

.content {
  //   width: 1050px;
  width: 100%;
  height: 650px;
  overflow-y: auto;
}

.bottom {
  display: flex;
  justify-content: center;
}
</style>
